namespace Northwind.Web.App
{
    using System.Collections.Generic;
    using Northwind.Domain.Core.Entities;
    using NRepository.Core;

    public class NorthwindAuditSaveCommandInterceptor : AuditSaveCommandInterceptorBase
    {
        protected override IEnumerable<IAuditItem> GetAuditItems()
        {
            // Set up monitoring on specific columns (Add change information to the AuditPropertyTrails table).
            return new[]
            {
                new AuditItem(
                    typeof(Category), 
//                    new AuditPropertyItem(PropertyInfo<Category>.GetMemberName(p => p.CategoryName), (p => ((string)p).ToLower())),
                    new AuditPropertyItem(PropertyInfo<Category>.GetMemberName(p => p.Description))),
                
                new AuditItem(
                    typeof(Customer), 
                    new AuditPropertyItem(PropertyInfo<Customer>.GetMemberName(p => p.CompanyName))),
            };
        }
    }
}